package com.agricultural.command;

import com.agricultural.equipment.AgriculturalEquipment;

public class PerformTaskCommand implements Command {
    private AgriculturalEquipment equipment;

    public PerformTaskCommand(AgriculturalEquipment equipment) {
        this.equipment = equipment;
    }

    @Override
    public void execute() {
        System.out.println("执行任务命令: " + equipment.getEquipmentId());
        equipment.performTask();
    }

    @Override
    public void undo() {
        System.out.println("暂停任务: " + equipment.getEquipmentId());
        equipment.stop();
    }

    @Override
    public String getDescription() {
        return equipment.getEquipmentId() + " 执行任务";
    }
}    